package com.gitee.wsl.ext.map


fun <K, V> Map<K, V>.selectValues(keys: Iterable<K>): List<V> {
    return selectValuesTo(ArrayList(), keys)
}

fun <K, V, C : MutableCollection<in V>> Map<K, V>.selectValuesTo(destination: C, keys: Iterable<K>): C {
    for (key in keys) {
        destination += get(key)!!
    }

    return destination
}